package com.dongdongshop.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.dongdongshop.data.Result;
import com.dongdongshop.em.ConstantEnum;
import com.dongdongshop.pojo.TbContent;
import com.dongdongshop.service.TbContentService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("content")
public class ContentController {

    @Reference
    private TbContentService tbContentService;

    @RequestMapping("getContentInfo/{obj}")
    @ResponseBody
    public Result findBanner(@PathVariable("obj")Integer obj){
        List<TbContent> list = tbContentService.getContentInfo(obj);
        return Result.build(ConstantEnum.SUCCESS).setResult(list);
    }

}
